/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.purpose.utils;

import com.koron.common.dfs.FastDFSClientWrapper;
import com.koron.common.util.DocConverterUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;


@Component
public class PdfFileUtil {
	
    @Autowired
    private DocConverterUtils docConverterUtils;
	
    public String getPdfUrl(MultipartFile file, FastDFSClientWrapper fastDFSClientWrapper) throws Exception{
    	return docConverterUtils.converterUpdate(file);
    	/*File pdfFile = docConverterUtils.converter(file);
        if (pdfFile == null) {
            return "";
        } else {
            String url = fastDFSClientWrapper.uploadFile(
                    new FileInputStream(pdfFile), pdfFile.length(),
                    FilenameUtils.getExtension(pdfFile.getName()));
            if(pdfFile.exists()){
            	pdfFile.delete();
			}
            return url;
        }*/
    }
}
